-
Notifications
You must be signed in to change notification settings - Fork 324
🪞 10269 - Feature: CICS tracing #10301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- ECIInteraction.execute -- instruments the entry point for CICS calls via IBM's javax.resource.cci.Interaction implementation, creating "cics.execute" span and recording a few tags. - JavaGatewayInstrumentation.flow -- records the peer.* tags on the "cics.execute" span created above, or if it doesn't exist, creates a new "gateway.flow" span. The tests don't fully exercise the CICS client-side code, however they exercise enough to ensure the instrumentation creates spans and adds tags as expected. This requires a few JAR files from IBM's CICS SDK for compliation and testing that are not available in Maven Central. A tar.gz artifact is downloaded from IBM's public CICS support archive and the necessary JARs are extracted, following the same pattern used for the JBoss Wildfly smoke tests.
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 62 metrics, 9 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.59.0-SNAPSHOT~e50a58ad69, baseline=1.59.0-SNAPSHOT~e74c6a793a
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.061 s) : 0, 1061022
Total [baseline] (10.913 s) : 0, 10912854
Agent [candidate] (1.061 s) : 0, 1061281
Total [candidate] (10.948 s) : 0, 10947924
section appsec
Agent [baseline] (1.233 s) : 0, 1233289
Total [baseline] (11.027 s) : 0, 11026874
Agent [candidate] (1.237 s) : 0, 1237177
Total [candidate] (11.111 s) : 0, 11110926
section iast
Agent [baseline] (1.228 s) : 0, 1228100
Total [baseline] (11.186 s) : 0, 11185535
Agent [candidate] (1.241 s) : 0, 1240574
Total [candidate] (11.107 s) : 0, 11107363
section profiling
Agent [baseline] (1.195 s) : 0, 1195405
Total [baseline] (10.964 s) : 0, 10964359
Agent [candidate] (1.186 s) : 0, 1185708
Total [candidate] (10.944 s) : 0, 10943935
gantt
title petclinic - break down per module: candidate=1.59.0-SNAPSHOT~e50a58ad69, baseline=1.59.0-SNAPSHOT~e74c6a793a
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.202 ms) : 0, 1202
crashtracking [candidate] (1.18 ms) : 0, 1180
BytebuddyAgent [baseline] (624.514 ms) : 0, 624514
BytebuddyAgent [candidate] (625.358 ms) : 0, 625358
AgentMeter [baseline] (28.719 ms) : 0, 28719
AgentMeter [candidate] (28.748 ms) : 0, 28748
GlobalTracer [baseline] (258.015 ms) : 0, 258015
GlobalTracer [candidate] (257.38 ms) : 0, 257380
AppSec [baseline] (33.072 ms) : 0, 33072
AppSec [candidate] (32.932 ms) : 0, 32932
Debugger [baseline] (61.51 ms) : 0, 61510
Debugger [candidate] (63.592 ms) : 0, 63592
Remote Config [baseline] (637.793 µs) : 0, 638
Remote Config [candidate] (604.239 µs) : 0, 604
Telemetry [baseline] (10.828 ms) : 0, 10828
Telemetry [candidate] (9.852 ms) : 0, 9852
Flare Poller [baseline] (6.89 ms) : 0, 6890
Flare Poller [candidate] (6.118 ms) : 0, 6118
section appsec
crashtracking [baseline] (1.184 ms) : 0, 1184
crashtracking [candidate] (1.178 ms) : 0, 1178
BytebuddyAgent [baseline] (652.237 ms) : 0, 652237
BytebuddyAgent [candidate] (653.412 ms) : 0, 653412
AgentMeter [baseline] (11.825 ms) : 0, 11825
AgentMeter [candidate] (11.93 ms) : 0, 11930
GlobalTracer [baseline] (257.679 ms) : 0, 257679
GlobalTracer [candidate] (259.228 ms) : 0, 259228
IAST [baseline] (25.685 ms) : 0, 25685
IAST [candidate] (25.836 ms) : 0, 25836
AppSec [baseline] (167.565 ms) : 0, 167565
AppSec [candidate] (168.298 ms) : 0, 168298
Debugger [baseline] (68.152 ms) : 0, 68152
Debugger [candidate] (68.193 ms) : 0, 68193
Remote Config [baseline] (672.616 µs) : 0, 673
Remote Config [candidate] (655.118 µs) : 0, 655
Telemetry [baseline] (9.308 ms) : 0, 9308
Telemetry [candidate] (9.419 ms) : 0, 9419
Flare Poller [baseline] (3.66 ms) : 0, 3660
Flare Poller [candidate] (3.669 ms) : 0, 3669
section iast
crashtracking [baseline] (1.184 ms) : 0, 1184
crashtracking [candidate] (1.189 ms) : 0, 1189
BytebuddyAgent [baseline] (791.538 ms) : 0, 791538
BytebuddyAgent [candidate] (799.571 ms) : 0, 799571
AgentMeter [baseline] (11.176 ms) : 0, 11176
AgentMeter [candidate] (11.51 ms) : 0, 11510
GlobalTracer [baseline] (248.294 ms) : 0, 248294
GlobalTracer [candidate] (250.87 ms) : 0, 250870
IAST [baseline] (26.97 ms) : 0, 26970
IAST [candidate] (27.15 ms) : 0, 27150
AppSec [baseline] (31.882 ms) : 0, 31882
AppSec [candidate] (34.459 ms) : 0, 34459
Debugger [baseline] (68.855 ms) : 0, 68855
Debugger [candidate] (67.316 ms) : 0, 67316
Remote Config [baseline] (543.766 µs) : 0, 544
Remote Config [candidate] (558.397 µs) : 0, 558
Telemetry [baseline] (8.652 ms) : 0, 8652
Telemetry [candidate] (8.731 ms) : 0, 8731
Flare Poller [baseline] (3.545 ms) : 0, 3545
Flare Poller [candidate] (3.627 ms) : 0, 3627
section profiling
crashtracking [baseline] (1.237 ms) : 0, 1237
crashtracking [candidate] (1.213 ms) : 0, 1213
BytebuddyAgent [baseline] (682.758 ms) : 0, 682758
BytebuddyAgent [candidate] (677.119 ms) : 0, 677119
AgentMeter [baseline] (8.684 ms) : 0, 8684
AgentMeter [candidate] (8.626 ms) : 0, 8626
GlobalTracer [baseline] (218.118 ms) : 0, 218118
GlobalTracer [candidate] (216.977 ms) : 0, 216977
AppSec [baseline] (32.756 ms) : 0, 32756
AppSec [candidate] (32.059 ms) : 0, 32059
Debugger [baseline] (68.117 ms) : 0, 68117
Debugger [candidate] (67.68 ms) : 0, 67680
Remote Config [baseline] (599.371 µs) : 0, 599
Remote Config [candidate] (591.355 µs) : 0, 591
Telemetry [baseline] (8.738 ms) : 0, 8738
Telemetry [candidate] (8.657 ms) : 0, 8657
Flare Poller [baseline] (3.808 ms) : 0, 3808
Flare Poller [candidate] (3.757 ms) : 0, 3757
ProfilingAgent [baseline] (100.205 ms) : 0, 100205
ProfilingAgent [candidate] (99.174 ms) : 0, 99174
Profiling [baseline] (100.787 ms) : 0, 100787
Profiling [candidate] (99.748 ms) : 0, 99748
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.59.0-SNAPSHOT~e50a58ad69, baseline=1.59.0-SNAPSHOT~e74c6a793a
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.074 s) : 0, 1073836
Total [baseline] (8.746 s) : 0, 8746244
Agent [candidate] (1.062 s) : 0, 1062375
Total [candidate] (8.721 s) : 0, 8720540
section iast
Agent [baseline] (1.234 s) : 0, 1233822
Total [baseline] (9.396 s) : 0, 9395736
Agent [candidate] (1.227 s) : 0, 1227298
Total [candidate] (9.37 s) : 0, 9370070
gantt
title insecure-bank - break down per module: candidate=1.59.0-SNAPSHOT~e50a58ad69, baseline=1.59.0-SNAPSHOT~e74c6a793a
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.201 ms) : 0, 1201
crashtracking [candidate] (1.192 ms) : 0, 1192
BytebuddyAgent [baseline] (632.207 ms) : 0, 632207
BytebuddyAgent [candidate] (627.251 ms) : 0, 627251
AgentMeter [baseline] (29.282 ms) : 0, 29282
AgentMeter [candidate] (28.919 ms) : 0, 28919
GlobalTracer [baseline] (260.566 ms) : 0, 260566
GlobalTracer [candidate] (259.03 ms) : 0, 259030
AppSec [baseline] (33.597 ms) : 0, 33597
AppSec [candidate] (33.021 ms) : 0, 33021
Debugger [baseline] (61.988 ms) : 0, 61988
Debugger [candidate] (62.242 ms) : 0, 62242
Remote Config [baseline] (634.92 µs) : 0, 635
Remote Config [candidate] (607.489 µs) : 0, 607
Telemetry [baseline] (10.053 ms) : 0, 10053
Telemetry [candidate] (9.105 ms) : 0, 9105
Flare Poller [baseline] (8.503 ms) : 0, 8503
Flare Poller [candidate] (5.357 ms) : 0, 5357
section iast
crashtracking [baseline] (1.195 ms) : 0, 1195
crashtracking [candidate] (1.178 ms) : 0, 1178
BytebuddyAgent [baseline] (796.942 ms) : 0, 796942
BytebuddyAgent [candidate] (791.121 ms) : 0, 791121
AgentMeter [baseline] (11.261 ms) : 0, 11261
AgentMeter [candidate] (11.215 ms) : 0, 11215
GlobalTracer [baseline] (249.92 ms) : 0, 249920
GlobalTracer [candidate] (248.597 ms) : 0, 248597
AppSec [baseline] (33.75 ms) : 0, 33750
AppSec [candidate] (34.043 ms) : 0, 34043
Debugger [baseline] (65.648 ms) : 0, 65648
Debugger [candidate] (66.288 ms) : 0, 66288
Remote Config [baseline] (544.206 µs) : 0, 544
Remote Config [candidate] (544.982 µs) : 0, 545
Telemetry [baseline] (8.472 ms) : 0, 8472
Telemetry [candidate] (8.612 ms) : 0, 8612
Flare Poller [baseline] (3.409 ms) : 0, 3409
Flare Poller [candidate] (3.521 ms) : 0, 3521
IAST [baseline] (27.056 ms) : 0, 27056
IAST [candidate] (26.817 ms) : 0, 26817
LoadParameters
See matching parameters
SummaryFound 1 performance improvements and 0 performance regressions! Performance is the same for 16 metrics, 19 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~e50a58ad69, baseline=1.59.0-SNAPSHOT~e74c6a793a
dateFormat X
axisFormat %s
section baseline
no_agent (17.986 ms) : 17805, 18168
. : milestone, 17986,
appsec (18.379 ms) : 18192, 18567
. : milestone, 18379,
code_origins (17.857 ms) : 17680, 18033
. : milestone, 17857,
iast (17.832 ms) : 17654, 18009
. : milestone, 17832,
profiling (18.852 ms) : 18661, 19042
. : milestone, 18852,
tracing (17.53 ms) : 17357, 17703
. : milestone, 17530,
section candidate
no_agent (18.909 ms) : 18713, 19105
. : milestone, 18909,
appsec (18.401 ms) : 18215, 18587
. : milestone, 18401,
code_origins (17.713 ms) : 17539, 17887
. : milestone, 17713,
iast (17.783 ms) : 17604, 17962
. : milestone, 17783,
profiling (19.02 ms) : 18829, 19211
. : milestone, 19020,
tracing (17.608 ms) : 17433, 17784
. : milestone, 17608,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~e50a58ad69, baseline=1.59.0-SNAPSHOT~e74c6a793a
dateFormat X
axisFormat %s
section baseline
no_agent (1.218 ms) : 1206, 1229
. : milestone, 1218,
iast (3.463 ms) : 3415, 3510
. : milestone, 3463,
iast_FULL (5.794 ms) : 5736, 5852
. : milestone, 5794,
iast_GLOBAL (3.628 ms) : 3568, 3688
. : milestone, 3628,
profiling (2.066 ms) : 2048, 2085
. : milestone, 2066,
tracing (1.796 ms) : 1780, 1811
. : milestone, 1796,
section candidate
no_agent (1.168 ms) : 1156, 1179
. : milestone, 1168,
iast (3.145 ms) : 3107, 3184
. : milestone, 3145,
iast_FULL (5.837 ms) : 5778, 5895
. : milestone, 5837,
iast_GLOBAL (3.598 ms) : 3541, 3654
. : milestone, 3598,
profiling (2.147 ms) : 2126, 2169
. : milestone, 2147,
tracing (1.821 ms) : 1805, 1837
. : milestone, 1821,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~e50a58ad69, baseline=1.59.0-SNAPSHOT~e74c6a793a
dateFormat X
axisFormat %s
section baseline
no_agent (15.52 s) : 15520000, 15520000
. : milestone, 15520000,
appsec (14.951 s) : 14951000, 14951000
. : milestone, 14951000,
iast (17.966 s) : 17966000, 17966000
. : milestone, 17966000,
iast_GLOBAL (17.748 s) : 17748000, 17748000
. : milestone, 17748000,
profiling (15.365 s) : 15365000, 15365000
. : milestone, 15365000,
tracing (14.691 s) : 14691000, 14691000
. : milestone, 14691000,
section candidate
no_agent (15.459 s) : 15459000, 15459000
. : milestone, 15459000,
appsec (15.303 s) : 15303000, 15303000
. : milestone, 15303000,
iast (17.9 s) : 17900000, 17900000
. : milestone, 17900000,
iast_GLOBAL (17.809 s) : 17809000, 17809000
. : milestone, 17809000,
profiling (15.157 s) : 15157000, 15157000
. : milestone, 15157000,
tracing (14.777 s) : 14777000, 14777000
. : milestone, 14777000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~e50a58ad69, baseline=1.59.0-SNAPSHOT~e74c6a793a
dateFormat X
axisFormat %s
section baseline
no_agent (1.473 ms) : 1462, 1485
. : milestone, 1473,
appsec (3.711 ms) : 3490, 3931
. : milestone, 3711,
iast (2.24 ms) : 2171, 2309
. : milestone, 2240,
iast_GLOBAL (2.296 ms) : 2226, 2366
. : milestone, 2296,
profiling (2.078 ms) : 2023, 2132
. : milestone, 2078,
tracing (2.058 ms) : 2004, 2111
. : milestone, 2058,
section candidate
no_agent (1.473 ms) : 1462, 1485
. : milestone, 1473,
appsec (3.762 ms) : 3540, 3983
. : milestone, 3762,
iast (2.25 ms) : 2180, 2319
. : milestone, 2250,
iast_GLOBAL (2.291 ms) : 2221, 2361
. : milestone, 2291,
profiling (2.095 ms) : 2038, 2152
. : milestone, 2095,
tracing (2.051 ms) : 1998, 2105
. : milestone, 2051,
|
| } | ||
|
|
||
| @Override | ||
| protected String service() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no need to override it since it's null on the base method
| */ | ||
| public AgentSpan onLocalConnection(final AgentSpan span, final InetSocketAddress localAddr) { | ||
| if (localAddr != null && localAddr.getAddress() != null) { | ||
| span.setTag("network.local.address", localAddr.getAddress().getHostAddress()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for having used otel attribute names
amarziali
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks for that addition. I left few comments for improvement
| final String tranName = spec.getTranName(); | ||
| final String tpnName = spec.getTPNName(); | ||
|
|
||
| span.setResourceName(interactionVerb + " " + functionName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as a future improvement this might be cached if the cardinality is not too high
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far, in my experience, the cardinality has 1 per service (with the note that we tend to do microservices).
| final int callDepth = CallDepthThreadLocalMap.getCallDepth(ECIInteraction.class); | ||
| if (callDepth > 0) { | ||
| // Inside execute() - add connection tags to the existing span instead of creating new one | ||
| final AgentSpan parentSpan = activeSpan(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a generally strong assumption. A way to make sure that the right span is always tracked is to use the context store here
ValentinZakharov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
bedb163 to
d3372cd
Compare
|
Heads-up: I noticed while testing that I'm not seeing the I wouldn't suggest blocking/delaying the merge on this, but there's a chance I might have a tweak soon if I figure out what's going on. |
No worries just added a label to say that we could wait a bit still targeting next release if possible |
|
@deejgregor any updates on this one? did you find time for additional testing? Is this PR ok to merge in the next minor? |
I haven't been able to get the local socket tags to work in deployed environments, so let's remove that for now: #10465 Other than that, everything looks great, and I'd say it's ready to go! I'd love to get this into the next release so we can work on deploying. :) |
This PR mirrors the changes from the original community contribution to enable CI testing with maintainer privileges.
Original PR: #10269
Original Author: @deejgregor
Original Branch: deejgregor/dd-trace-java:feature-cics-tracing
Closes #10269
This is an automated mirror created to run CI checks. See tooling/mirror-community-pull-request.sh for details.